@extends('backend/layouts/default')
@section('title')
<?= isset($data['tone']->id) ? "Sửa giai điệu" : "Thêm giai điệu mới"; ?>
@stop
@section('content')
<h3>
    <span
        class="glyphicon glyphicon-user"></span> <?= isset($data['tone']->id) ? "Sửa giai điệu" : "Thêm giai điệu mới"; ?>
</h3>
<form class="form-horizontal" role="form" method="post" action="{{ route('create/tone') }}" autocomplete="off">
    {{ Form::token() }}
    <input type="hidden" name="data[Tone][id]" value="{{ $data['tone']->id }}"/>

    <div class="row">
        <div class="col-md-9">
            <div class="form-group <?= $errors->has('title') ? 'error' : '' ?>">
                <label class="control-label col-sm-4" for="title">
                    Tên giai điệu
                </label>

                <div class="col-sm-8">
                    <input name="data[Tone][title]" name="data[Tone][title]" value="<?= $data['tone']->title ?>"
                           class="form-control"/>
                    <?= $errors->first('title', '<span class="help-inline">:message</span>') ?>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4" for="description">
                    Mô tả
                </label>

                <div class="col-sm-8">
                    <textarea id="textareabox" name="data[Tone][description]" class="form-control">
                        <?= $data['tone']->description ?>
                    </textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4">Video</label>

                <div class="col-sm-8">
                    <input type="text" class="form-control" id="data[Tone][video]" name="data[Tone][video]"
                           value="<?= $data['tone']->video ?>"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4">Bài giảng</label>

                <div class="col-sm-8">
                    <input type="text" class="form-control" id="data[Tone][lesson_id]" name="data[Tone][lesson_id]"
                           value="<?= $data['tone']->lesson_id ?>"/>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4">Trạng thái</label>

                <div class="col-sm-5">
                    <?= Form::select('data[Tone][status]', array('on' => 'Sử dụng', 'off' => 'Không sử dụng'), Input::old('data[Tone][status]', $data['tone']->status), array('class' => 'form-control')) ?>
                </div>

            </div>
            <div class="control-group" align="right">
                <div class="controls">
                    <a class="btn btn-link" href="{{ route('tones') }}">Hủy</a>
                    <button type="submit" class="btn btn-success">Lưu</button>
                </div>
            </div>
        </div>
    </div>

</form>
@stop